﻿using MvcApplication.Common;
using MvcApplication.Interface;
using System.Net;
using System.Threading;
using System.Threading.Tasks;
using System.Web.Mvc;


namespace MvcApplication.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            return View();
        }

        public ActionResult TestAsync()
        {
            Task.Factory.StartNew(() =>
            {
                Thread.Sleep(10000);
            });

            return Content("axb");
        }

        public ActionResult TestLog(string log)
        {
            LogUtil.Debug(log);
            return Content(System.AppDomain.CurrentDomain.BaseDirectory);
        }

        public ActionResult TestGetTest()
        {
            using (WebClient client = new WebClient())
            {
                var html = client.DownloadString("http://dintang.com/post_13000040#rw-layout");
                return Content(html);
            }
        }
    }
}
